﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ScenicSpots.aspx.cs" Inherits="aucn.web.thai.ScenicSpots" MasterPageFile="~/MasterPage.Master" Title="泰国景点" %>

<%@ Register src="~/au/ImageWithH1.ascx" tagname="ImageWithH1" tagprefix="uc1" %>
<asp:Content runat="server" ContentPlaceHolderID="head">
<script src="/au/scripts/jqModal.js" language="javascript" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
$().ready(function() {
  $('#dialog').jqm();
});

function Prepare(n)
{
    $('#dialog').jqmShow();
    Loading();
    // Post data
    $.get('ScenicSpots.aspx', {sitename:n}, ShowDetail);
}

function ShowDetail(xml)
{
    var root = $(xml).find("site");
    var dialog = $('#dialog');
    $('#dialog>#sitename').text(root.find('name').text());
    $('#siteContent>#sitetext').text(root.find('desc').text());
    
    
    if(root.find('hours').text()!='')
    {
        $('#siteContent>#hours').text("开放时间：" + root.find('hours').text());
    }
    
    if(root.find('addr').text()!='')
    {
        $('#siteContent>#addr').text("地址：" + root.find('addr').text());
    }
    
    if(root.find('fee').text()!='')
    {
        $('#siteContent>#fee').text("费用：" + root.find('fee').text());
    }
    
    if(root.find('web').text()!='')
    {
        $('#siteContent>#web').html("网址：" + "<a target='_blank' href='http://" + root.find('web').text() + "'>" + root.find('web').text() + "</a>");
    }

    $('#siteContent').css('display', '');
}

function CloseDetail()
{
     $('#dialog').jqmHide();
 }

 function Loading() {
     $('#dialog>#sitename').text('读取中……');
     $('#siteContent').css('display', 'none');
 }
</script>
</asp:Content>
<asp:Content runat="server" ID="ContentHolder1" ContentPlaceHolderID="ContentPlaceHolder1">
<div class="jqmWindow" id="dialog">
<div style="text-align:right">
<a onclick="CloseDetail()" style="cursor:pointer;">关闭</a>
</div>
<hr />
<h2 style="font-size:1.3em;color:Teal" id="sitename"></h2>
<div id="siteContent">
    <div id="sitetext"></div>
    <div id="hours"></div>
    <div id="addr"></div>
    <div id="fee"></div>
    <div id="tel"></div>
    <div id="web"></div>
</div>
</div>
    <div class="stdlm left">
    <uc1:ImageWithH1 runat="server" ID="H11" H1Content="泰国景点" ImageAltText="泰国景点" ImageUrl="~/au/images/headings/thaitour.png" />
    <div>
    
        <asp:DataList RepeatColumns="3" RepeatLayout="Table" Width="50em" ID="DataList1" runat="server" DataSourceID="XmlDataSource1">
            <ItemTemplate>
                <a style="cursor:pointer" onclick='Prepare("<%# Eval("name") %>")'><%# Eval("name") %></a>
            </ItemTemplate>
        </asp:DataList>
        <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/App_Data/thaitour.xml">
        </asp:XmlDataSource>
    </div>
</div>
</asp:Content>